﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IndexCM.aspx.cs" Inherits="DATN.mds.ContactManagement.IndexCM" MasterPageFile="~/InternalSite.Master"%>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent1" runat="server">
    <script type="text/javascript">
<!--
    function confirmation() {
        var answer = confirm("xem thông tin?")
        if (answer) {
            alert("Tên là")
        }
        else {
            alert("Thanks for sticking around!")
        }
    }
//-->
</script>

<div id="contentx" class="clearingfix">
                    <center>
                            <br/>
                        <h3>Qu&#7843;n lý khách hàng</h3>
                        <hr/>
                    </center>

              <div class="floatboxinternal">


   <asp:Label ID="Lb_Stt" runat="server" Text=""></asp:Label>
   <br/>

   <asp:Button ID="bt_CreateCM" runat="server" Text="T&#7841;o M&#7899;i Khách Hàng" CssClass="bty"
        onclick="bt_CreateCM_Click" />


    <asp:GridView ID="Grd_SearchTrend"
                  AutoPostBack="False" 
                  CssClass = "gridviewcss"
                  runat="server"
                  RowStyle-CssClass = "Grd_Row"
                  AutoGenerateColumns= "False"
                  OnRowCommand="GridView1_RowCommand"  
                  OnRowDataBound = "Grd_ContactAll_RowDataBound " CellPadding="2" 
        ForeColor="Black" GridLines="Vertical" ShowFooter="True" BackColor="White" 
        BorderColor="#90abb8" BorderStyle="None" BorderWidth="1px" PageSize="25" 
                      UseAccessibleHeader="False">
                  
                  <AlternatingRowStyle BackColor="White" />
                  <Columns>
            <asp:TemplateField>
                 <HeaderTemplate>
                 <asp:Image ID="imgTab" onclick="javascript:Toggle(this);" 
                 runat="server" ImageUrl="~/Content/images/expand-icon1.png" ToolTip="Collapse" />
                    </HeaderTemplate>
              
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
            </asp:TemplateField>
 
          <asp:TemplateField>
                <HeaderTemplate>H&#7885; Và Tên </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Lb_LastName" 
                                runat="server" 
                                Text='<%# DataBinder.Eval(Container.DataItem, "LastName") %>'></asp:Label>
                   <asp:Label ID="Lb_FirstName" 
                                runat="server" 
                                Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="170px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="170px" />
            </asp:TemplateField>
            
            <asp:TemplateField>
                <HeaderTemplate>Gi&#7899;i Tính</HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Lb_Sex" 
                                runat="server" 
                                Text='<%# DataBinder.Eval(Container.DataItem, "Sex") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" />
            </asp:TemplateField>

            <asp:BoundField DataField="Phone" HeaderText="&#272;i&#7879;n Tho&#7841;i"
                 NullDisplayText='<img src="../Content/images/error.png" />'>  
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" />
            </asp:BoundField>

            
      <%--    <asp:TemplateField>
                <HeaderTemplate>&#272;&#7883;a Ch&#7881;</HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Lb_Address" 
                                runat="server" 
                                Text='<%# DataBinder.Eval(Container.DataItem, "Address") %>'></asp:Label>,
                   <asp:Label ID="Lb_City" 
                                runat="server" 
                                Text='<%# DataBinder.Eval(Container.DataItem, "City") %>'></asp:Label>

                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="140px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="140px" />
            </asp:TemplateField>--%>
           

            <asp:BoundField DataField="Habit" HeaderText="S&#7903; Thích"
                            NullDisplayText='<img src="../Content/images/error.png" />'> 
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="250px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="250px" />
                            </asp:BoundField>


            <asp:BoundField DataField="Company" HeaderText="Công Ty"
                            NullDisplayText='<img src="../Content/images/error.png" alt="c&#7853;p nh&#7853;t thêm thông tin"/>'>  
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" />
                            </asp:BoundField>

            <asp:TemplateField>
                <HeaderTemplate>Thao Tác</HeaderTemplate>
                <ItemTemplate>
                   <asp:LinkButton ID="LinkButton4" 
                                   CommandArgument='<%# Eval("Cus_Id") %>' 
                                   CommandName="Xem" runat="server">
                                    Xem</asp:LinkButton>
                    |
                   <asp:LinkButton ID="LinkButton2" 
                                   CommandArgument='<%# Eval("Cus_Id") %>' 
                                   CommandName="Edit" runat="server">
                                    S&#7917;a</asp:LinkButton>
                    |
                   <asp:LinkButton ID="LinkButton1" 
                                   CommandArgument='<%# Eval("Cus_Id") %>' 
                                   CommandName="Delete" runat="server">
                                    Xóa</asp:LinkButton>
                    |
                   <asp:LinkButton ID="LinkButton3" 
                                   CommandArgument='<%# Eval("Cus_Id") %>' 
                                   CommandName="Mail" runat="server">
                                    Mail</asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="170px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px" />
            </asp:TemplateField>
            </Columns>
                  <FooterStyle BackColor="#004a96" />
                  <HeaderStyle BackColor="#004a96" Font-Bold="True" ForeColor="White" />
                  <PagerStyle BackColor="#80bed9" ForeColor="Black" HorizontalAlign="Right" />
                  <RowStyle BackColor="#b4cbd5" />
                  <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                  <SortedAscendingCellStyle BackColor="#FBFBF2" />
                  <SortedAscendingHeaderStyle BackColor="#848384" />
                  <SortedDescendingCellStyle BackColor="#EAEAD3" />
                  <SortedDescendingHeaderStyle BackColor="#575357" />
        </asp:GridView>

        <asp:Button ID="Btn_Previous" CommandName="Previous" CssClass="btx"
            runat="server" OnCommand="ChangePage" 
            Text=" <<< Tr&#432;&#7899;c" onclick="Btn_Previous_Click" 
           />
        <asp:Button ID="Btn_Next" runat="server" CommandName="Next" CssClass="btx"
            OnCommand="ChangePage" Text="Sau >>> " onclick="Btn_Next_Click"/>
        <b>(
        <asp:Label ID="lblCurrentPage" runat="server" Text=""></asp:Label>
        /<asp:Label ID="lblTotalPages" runat="server" Text=""></asp:Label>) Trang
        </b>
        <br/>
       <asp:Button ID="bt_ImportExcel" runat="server" Text="Nh&#7853;p T&#7915; Excel" CssClass="bty" 
                      onclick="bt_ImportExcel_Click" />
       <asp:Button ID="bt_ExportExcel" runat="server" Text="Xu&#7845;t Ra Excel" CssClass="bty" 
                      onclick="bt_ExportExcel_Click" />


                      
<!--============================================================================================================-->
<!--============================================================================================================-->
<!--============================ Hi&#7879;n thông tin Khách Hàng &#273;&#432;&#7907;c ch&#7885;n ===============================================-->
<!--============================================================================================================-->
                  <table style="font-size:small">
                      <tr>
                          <td>
                              <asp:Label ID="Name" Visible ="false" runat="server" Text=""></asp:Label>
                              <asp:Label ID="Sex" Visible ="false" runat="server" Text=""></asp:Label>
                              <asp:Label ID="Birthday" Visible ="false" runat="server" Text=""></asp:Label>
                          </td>
                          <td>
                              &nbsp;
                          </td>
                          <td>
                              &nbsp;
                          </td>
                      </tr>
                      <tr>
                          <td>
                              <asp:Label ID="Phone" Visible ="false" runat="server" Text=""></asp:Label>
                              <asp:Label ID="Mail" Visible ="false" runat="server" Text=""></asp:Label>
                              <asp:Label ID="Address" Visible ="false"  runat="server" Text=""></asp:Label>
                          </td>
                          <td>
                              &nbsp;
                          </td>
                          <td>
                              &nbsp;
                          </td>
                      </tr>
                      <tr>
                          <td>
                              <asp:Label ID="Company" Visible ="false" runat="server" Text=""></asp:Label>
                              <asp:Label ID="Married" Visible ="false" runat="server" Text=""></asp:Label>
                          </td>
                          <td>
                              &nbsp;
                          </td>
                          <td>
                              &nbsp;
                          </td>
                      </tr>
                      <tr>
                          <td>
                             <asp:Label ID="Job" Visible ="false" runat="server" Text=""></asp:Label>
                              <asp:Label ID="Salary" Visible ="false" runat="server" Text=""></asp:Label>
                          </td>
                          <td>
                              &nbsp;
                          </td>
                          <td>
                              &nbsp;
                          </td>
                      </tr>
                      <tr>
                          <td>
                             <asp:Label ID="Habit" Visible ="false" runat="server" Text=""></asp:Label>
                          </td>
                          <td>
                              &nbsp;
                          </td>
                          <td>
                              &nbsp;
                          </td>
                      </tr>
                  </table>
<!--============================================================================================================-->
<!--============================================================================================================-->
<!--============================================================================================================-->

       </div>
 </div>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent2" runat="server"> 
</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="MainContent3" runat="server">

<script type="text/javascript">
        var Grid = null;
        var UpperBound = 0;
        var LowerBound = 1;
        var CollapseImage = '/Content/images/expand-icon1.png';
        var ExpandImage = '/Content/images/expand-icon2.png';
        var IsExpanded = true;
        var Rows = null;
        var n = 1;
        var TimeSpan = 25;

        window.onload = function () {
            Grid = document.getElementById('<%= this.Grd_SearchTrend.ClientID %>');
            UpperBound = parseInt('<%= this.Grd_SearchTrend.Rows.Count %>');
            Rows = Grid.getElementsByTagName('tr');
        }

        function Toggle(Image) {
            ToggleImage(Image);
            ToggleRows();
        }

        function ToggleImage(Image) {
            if (IsExpanded) {
                Image.src = ExpandImage;
                Image.title = 'Expand';
                Grid.rules = 'none';
                n = LowerBound;

                IsExpanded = false;
            }
            else {
                Image.src = CollapseImage;
                Image.title = 'Collapse';
                Grid.rules = 'cols';
                n = UpperBound;

                IsExpanded = true;
            }
        }

        function ToggleRows() {
            if (n < LowerBound || n > UpperBound) return;

            Rows[n].style.display = Rows[n].style.display == '' ? 'none' : '';
            if (IsExpanded) n--; else n++;
            setTimeout("ToggleRows()", TimeSpan);
        }
</script>
</asp:Content>

